package o;

import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import androidx.transition.Transition;
import androidx.transition.Transition.b;
import androidx.transition.TransitionSet;
import java.util.ArrayList;
import java.util.List;

@RestrictTo({d.ˊ})
public class nc extends ke {
    public boolean ॱ(Object obj) {
        return obj instanceof Transition;
    }

    public Object ˊ(Object obj) {
        if (obj != null) {
            return ((Transition) obj).ॱˋ();
        }
        return null;
    }

    public Object ˏ(Object obj) {
        if (obj == null) {
            return null;
        }
        Object transitionSet = new TransitionSet();
        transitionSet.ˋ((Transition) obj);
        return transitionSet;
    }

    public void ˏ(Object obj, View view, ArrayList<View> arrayList) {
        TransitionSet transitionSet = (TransitionSet) obj;
        List ʽ = transitionSet.ʽ();
        ʽ.clear();
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ke.ˎ(ʽ, (View) arrayList.get(i));
        }
        ʽ.add(view);
        arrayList.add(view);
        ॱ(transitionSet, arrayList);
    }

    public void ˎ(Object obj, View view) {
        if (view != null) {
            Transition transition = (Transition) obj;
            final Rect rect = new Rect();
            ˊ(view, rect);
            transition.ˎ(new Transition.d(this) {
                final /* synthetic */ nc ˊ;

                public Rect ˏ(@NonNull Transition transition) {
                    return rect;
                }
            });
        }
    }

    public void ॱ(Object obj, ArrayList<View> arrayList) {
        int i = 0;
        Transition transition = (Transition) obj;
        if (transition != null) {
            int ᐝॱ;
            if (transition instanceof TransitionSet) {
                TransitionSet transitionSet = (TransitionSet) transition;
                ᐝॱ = transitionSet.ᐝॱ();
                while (i < ᐝॱ) {
                    ॱ(transitionSet.ˋ(i), arrayList);
                    i++;
                }
            } else if (!ॱ(transition) && ke.ˎ(transition.ʽ())) {
                int size = arrayList.size();
                for (ᐝॱ = 0; ᐝॱ < size; ᐝॱ++) {
                    transition.ˊ((View) arrayList.get(ᐝॱ));
                }
            }
        }
    }

    private static boolean ॱ(Transition transition) {
        return (ke.ˎ(transition.ʻ()) && ke.ˎ(transition.ʼ()) && ke.ˎ(transition.ᐝ())) ? false : true;
    }

    public Object ॱ(Object obj, Object obj2, Object obj3) {
        TransitionSet transitionSet = new TransitionSet();
        if (obj != null) {
            transitionSet.ˋ((Transition) obj);
        }
        if (obj2 != null) {
            transitionSet.ˋ((Transition) obj2);
        }
        if (obj3 != null) {
            transitionSet.ˋ((Transition) obj3);
        }
        return transitionSet;
    }

    public void ˊ(Object obj, final View view, final ArrayList<View> arrayList) {
        ((Transition) obj).ˊ(new b(this) {
            final /* synthetic */ nc ˊ;

            public void ॱ(@NonNull Transition transition) {
            }

            public void ˋ(@NonNull Transition transition) {
                transition.ॱ((b) this);
                view.setVisibility(8);
                int size = arrayList.size();
                for (int i = 0; i < size; i++) {
                    ((View) arrayList.get(i)).setVisibility(0);
                }
            }

            public void ˊ(@NonNull Transition transition) {
            }

            public void ˏ(@NonNull Transition transition) {
            }
        });
    }

    public Object ˏ(Object obj, Object obj2, Object obj3) {
        Transition transition = null;
        Transition transition2 = (Transition) obj;
        Transition transition3 = (Transition) obj2;
        Transition transition4 = (Transition) obj3;
        if (transition2 != null && transition3 != null) {
            transition = new TransitionSet().ˋ(transition2).ˋ(transition3).ˊ(1);
        } else if (transition2 != null) {
            transition = transition2;
        } else if (transition3 != null) {
            transition = transition3;
        }
        if (transition4 == null) {
            return transition;
        }
        TransitionSet transitionSet = new TransitionSet();
        if (transition != null) {
            transitionSet.ˋ(transition);
        }
        transitionSet.ˋ(transition4);
        return transitionSet;
    }

    public void ˋ(ViewGroup viewGroup, Object obj) {
        nr.ˊ(viewGroup, (Transition) obj);
    }

    public void ॱ(Object obj, Object obj2, ArrayList<View> arrayList, Object obj3, ArrayList<View> arrayList2, Object obj4, ArrayList<View> arrayList3) {
        final Object obj5 = obj2;
        final ArrayList<View> arrayList4 = arrayList;
        final Object obj6 = obj3;
        final ArrayList<View> arrayList5 = arrayList2;
        final Object obj7 = obj4;
        final ArrayList<View> arrayList6 = arrayList3;
        ((Transition) obj).ˊ(new b(this) {
            final /* synthetic */ nc ᐝ;

            public void ॱ(@NonNull Transition transition) {
                if (obj5 != null) {
                    this.ᐝ.ˏ(obj5, arrayList4, null);
                }
                if (obj6 != null) {
                    this.ᐝ.ˏ(obj6, arrayList5, null);
                }
                if (obj7 != null) {
                    this.ᐝ.ˏ(obj7, arrayList6, null);
                }
            }

            public void ˋ(@NonNull Transition transition) {
            }

            public void ˊ(@NonNull Transition transition) {
            }

            public void ˏ(@NonNull Transition transition) {
            }
        });
    }

    public void ˎ(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        obj = (TransitionSet) obj;
        if (obj != null) {
            obj.ʽ().clear();
            obj.ʽ().addAll(arrayList2);
            ˏ(obj, (ArrayList) arrayList, (ArrayList) arrayList2);
        }
    }

    public void ˏ(Object obj, ArrayList<View> arrayList, ArrayList<View> arrayList2) {
        int i = 0;
        Transition transition = (Transition) obj;
        int ᐝॱ;
        if (transition instanceof TransitionSet) {
            TransitionSet transitionSet = (TransitionSet) transition;
            ᐝॱ = transitionSet.ᐝॱ();
            while (i < ᐝॱ) {
                ˏ(transitionSet.ˋ(i), (ArrayList) arrayList, (ArrayList) arrayList2);
                i++;
            }
        } else if (!ॱ(transition)) {
            List ʽ = transition.ʽ();
            if (ʽ.size() == arrayList.size() && ʽ.containsAll(arrayList)) {
                ᐝॱ = arrayList2 == null ? 0 : arrayList2.size();
                for (int i2 = 0; i2 < ᐝॱ; i2++) {
                    transition.ˊ((View) arrayList2.get(i2));
                }
                for (ᐝॱ = arrayList.size() - 1; ᐝॱ >= 0; ᐝॱ--) {
                    transition.ˏ((View) arrayList.get(ᐝॱ));
                }
            }
        }
    }

    public void ˏ(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).ˊ(view);
        }
    }

    public void ˊ(Object obj, View view) {
        if (obj != null) {
            ((Transition) obj).ˏ(view);
        }
    }

    public void ˏ(Object obj, final Rect rect) {
        if (obj != null) {
            ((Transition) obj).ˎ(new Transition.d(this) {
                final /* synthetic */ nc ॱ;

                public Rect ˏ(@NonNull Transition transition) {
                    if (rect == null || rect.isEmpty()) {
                        return null;
                    }
                    return rect;
                }
            });
        }
    }
}
